#encoding=utf-8
import pymysql
try:
    conn=pymysql.connect(host='localhost',port=3306,db='mydb',user='root',passwd='root',charset='utf8')
    cs1=conn.cursor()
    count=cs1.execute("insert into students(sname) values('张良')")
    print(count)
    conn.commit()
    cs1.close()
    conn.close()
except Exception:
    print("cuowu")